package com.token.sysflow.enumerate;

/**
 * 环节类型
 */
public enum StepTypeEnum {
    /**
     * 起草，结束，决策，普通审批，子流程，会签，会审。
     */
    STEPTYPE_START("start",1),
    STEPTYPE_END("end",1),
    STEPTYPE_TASK("task",1),
    STEPTYPE_FORK("fork",1),
    STEPTYPE_TASK_ZLC("task_zlc",4),
    STEPTYPE_TASK_HQ("task_hq",3),
    STEPTYPE_TASK_HS("task_hs",2);

    private final String typeKey;
    private final int approvalType;
    StepTypeEnum(String typeKey,int approvalType) {
        this.typeKey = typeKey;
        this.approvalType = approvalType;
    }


    public String getTypeKey() {
        return typeKey;
    }

    public int getApprovalType(){
        return approvalType;
    }
    /**
     * 通过value取枚举
     * @param value
     * @return
     */
    public static StepTypeEnum getStepTypeByValue(String value){
        for (StepTypeEnum enums : StepTypeEnum.values()) {
            if (enums.getTypeKey().equals(value)) {
                return enums;
            }
        }
        return null;
    }
}